gContextMenu.showItem("context-goo_gl_lite-current", !(gContextMenu.isContentSelected || gContextMenu.onTextInput || gContextMenu.onLink || gContextMenu.onImage || gContextMenu.onVideo || gContextMenu.onAudio)); // Shows Copy Goo.gl URL for This Page whenever Bookmark This Page is shown
gContextMenu.showItem("context-goo_gl_lite-link", gContextMenu.onLink && !gContextMenu.onMailtoLink); // Shows Copy Goo.gl URL for Link Location whenver Bookmark this Link is shown.
};
/**
* Makes a short url from long_url
* @param long_url long url, unescaped.
*/
this.make_short_url = function(long_url)
{
var req = new XMLHttpRequest();
req.addEventListener("load", function()
{
var response = JSON.parse(req.responseText);
if(response.error_message)
{
goo_gl_lite.error("Gateway returned error message: " + response.error_message);
}
goo_gl_lite.notify(response.short_url + " has been copied to the clipboard. Shortened from " + long_url, "PRIORITY_INFO_MEDIUM");
gClipboardHelper.copyString(response.short_url);
}, false);
req.addEventListener("error", function()
{
goo_gl_lite.error("Error contacting gateway. Status code: " + req.status);